package com.sunxd.vue.bean;

import java.io.Serializable;

public abstract class AbstractPage implements Serializable {
    public static final int DEFAULT_PAGE_NO = 1;
    public static final int DEFAULT_PAGE_SIZE = 20;
    public static final int MIN_PAGE_SIZE = 1;
    public static final int MAX_PAGE_SIZE = 100;
    private static final long serialVersionUID = -3583130481377033176L;
    private int pageNo = 1;
    private int pageSize = 20;

    public void checkParam() {
        if (this.pageNo < 1) {
            this.pageNo = 1;
        }

        if (this.pageSize < 1) {
            this.pageSize = 20;
        }

        if (this.pageSize > 100) {
            this.pageSize = 100;
        }

    }

    public int getPageNo() {
        return this.pageNo;
    }

    public int getPageSize() {
        return this.pageSize;
    }

    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public AbstractPage() {
    }
}